<template>
  <div class="child">
    <h1>我是Child组件</h1>
    <h2>我有一个玩具：{{toy}}</h2>
    <button @click="sendToy(toy)">点我把玩具传给父亲</button>
  </div>
</template>

<script>
  export default {
    name:'Child',
    props:['sendToy'],
    data() {
      return {
        toy:'奥特曼'
      }
    },
  }
</script>

<style>
  .child{
    background-color: orange;
    padding: 20px;
    box-shadow: 0 0 10px black;
    border-radius: 10px;
  }
</style>